[#ftl]

<div id="msgs">
[@c.showErrors "" /]
</div>
<div class="dataForm">
	<form id="dataform" action="update" method="post">
		<div class="content">
		    [#if bean?exists]
			<dl>
			 
			<dt><span   class="required">*</span>名称</dt>
			<dd>
			<input  id="beanId" name="id"   type="hidden"  value="${bean.id!''}"/>
			
			<input  class="required" name="name"   type="text"  value="${bean.name!''}"/>
			</dd>
			
			<dt>类型</dt>
			<dd>
			    [@c.select id="type" value='${bean.type}' attributes='class="clear"' datas="system.resource.type" /]
 
			</dd>
			
			<dt>url</dt>
			<dd><input  name="entry" type="text" value="${bean.entry!''}"  /> </dd>
			
			<dt>权限</dt>
			<dd><input name="permission" type="text" value="${bean.permission!''}" />
				<span class="tip">以xxx:xxxx:xxx形式</span>
			</dd>
			<dt>代码</dt>
            <dd><input name="code" type="text" value="${bean.code!''}"/>
                <span class="tip">以xxx:xxxx:xxx形式</span>
            </dd>
			<dt>显示</dt>
            <dd>
               [@c.select id="display" value='${bean.display!"1"}' attributes='class="clear"' datas="common.display" /]
            </dd>
            <dt>显示位置</dt>
            <dd>
               [@c.select id="showPos" value='${(bean.showPos)!"0"}' attributes='class="clear"' datas="system.resource.showpos" /]
            </dd>
			<dt>显示顺序</dt>
			<dd><input name="sequence" class="integer" type="text" value="${bean.sequence!0}"/></dd>
			
			<dt>是否启用</dt>
			<dd>
				启用：    <input  name="disabled"  class="radio"  type="radio" value="0"  [#if (bean.disabled)?? && !bean.disabled]checked[/#if]/>
				不启用：<input  name="disabled"  class="radio"  type="radio" value="1"  [#if (bean.disabled)?? && bean.disabled]checked[/#if]/>
			</dd>
			<dt>描述</dt>
			<dd>
				<textarea rows="5" cols="38" id="description" name="description"></textarea>
			</dd>
			<dl>
			[/#if]
			<div class="clear"></div>
		</div>
		<div class="toolBar">
		     [#--
		    <input type="button" id="butAdd"  class="btn_1" value="增加" title="增加子模块"/>
			<input type="button" id="butDel" class="btn_1" value="删除"/>
			--]
			<input type="button" id="butUpd" class="btn_1" value="保存"/>
		</div>
	</form>
</div>
<script type="text/javascript">
$(document).ready(function(){
	$('#butUpd').click(function(){
			$('#dataform').submit();
	});
	
	var v = jQuery("#dataform").validate({
        		submitHandler: function(form) {
        			jQuery(form).ajaxSubmit({
        			    url:"resource/"+$("#beanId").val()+"/update",
        				//target: "#detail"
        				success: function(msgs){
                               extendMessages(msgs);
                               //if(msgs.isAllSuccess()){
                               //}else{
                               //}
                               alert(msgs.msg.message);
                        }
        			});
        		}
	});
});
</script>
